/*
 * Copyright (C) 2012 Jakub Narloch (jmnarloch@gmail.com), All Rights Reserved.
 */

package org.soa.security.model.entities;

import javax.persistence.Entity;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;

/**
 * <p>Represents a database data source.</p>
 *
 * <p><strong>Thread safety:</strong> This class is mutable and not thread safe.</p>
 *
 * @author Jakub Narloch (jmnarloch@gmail.com)
 * @version 1.0
 */
@Entity
public class DatabaseDataSource extends DataSource {

    /**
     * <p>Represents the database connection string.</p>
     *
     * <p>Null by default.</p>
     *
     * <p>Can by any value.</p>
     *
     * <p>Has getter and setter.</p>
     */
    @NotNull
    private String connectionString;

    /**
     * <p>Represents the database driver class name.</p>
     *
     * <p>Null by default.</p>
     *
     * <p>Can by any value.</p>
     *
     * <p>Has getter and setter.</p>
     */
    @NotNull
    private String driverClass;

    /**
     * <p>Represents the database schema name.</p>
     *
     * <p>Null by default.</p>
     *
     * <p>Can by any value.</p>
     *
     * <p>Has getter and setter.</p>
     */
    @Null
    private String schemaName;

    /**
     * <p>Creates new instance of {@link DatabaseDataSource} class.</p>
     */
    public DatabaseDataSource() {
        // empty constructor
    }

    /**
     * <p>Retrieves the database connection string.</p>
     *
     * @return the database connection string
     */
    public String getConnectionString() {
        return connectionString;
    }

    /**
     * <p>Sets the database connection string.</p>
     *
     * @param connectionString the database connection string
     */
    public void setConnectionString(String connectionString) {
        this.connectionString = connectionString;
    }

    /**
     * <p>Retrieves the database driver class name.</p>
     *
     * @return the database driver class name
     */
    public String getDriverClass() {
        return driverClass;
    }

    /**
     * <p>Sets the database driver class name.</p>
     *
     * @param driverClass the database driver class name
     */
    public void setDriverClass(String driverClass) {
        this.driverClass = driverClass;
    }

    /**
     * <p>Retrieves the database schema name.</p>
     *
     * @return the database schema name
     */
    public String getSchemaName() {
        return schemaName;
    }

    /**
     * <p>Sets the database schema name.</p>
     *
     * @param schemaName the database schema name
     */
    public void setSchemaName(String schemaName) {
        this.schemaName = schemaName;
    }
}
